<template>
  <div class='container'>
    <Head />
    <div class='info'>
<!--      <img-->
<!--        @click='open'-->
<!--        src='https://avatars.githubusercontent.com/u/49810511?s=96&v=4'-->
<!--        width='68'-->
<!--        height='68'-->
<!--        alt='@youliso'-->
<!--      />-->
<!--      <div @click='open' class='name'>七戒</div>-->
<!--      https://blog.csdn.net/weixin_44423437?spm=3001.5343-->
      <div class="row" @click="open('https://gitee.com/seven_commandments')">gitee: <span>七戒</span></div>
      <div class="row" @click="open('https://blog.csdn.net/weixin_44423437?spm=3001.5343')">
        csdn: <span>Kevin_七戒</span>
      </div>
<!--      <button @click='toHome'>首页</button>-->
    </div>
  </div>
</template>

<script lang='ts'>
import { BrowserWindowConstructorOptions } from 'electron';
import { defineComponent, onMounted } from 'vue';
import Head from '../components/Head.vue';
import { windowCreate, windowShow } from '@/renderer/utils/window';
import { argsData } from '@/renderer/store';
import { openUrl } from '@/renderer/utils';

export default defineComponent({
  components: {
    Head
  },
  name: 'About',
  setup() {
    function toHome() {
      let data: BrowserWindowConstructorOptions = {
        customize: {
          isMainWin: true,
          route: '/'
        },
        resizable: true
      };
      windowCreate(data);
    }

    function open(url:string) {
      openUrl(url);
    }

    onMounted(() => {
      windowShow(argsData.window.id);
    });

    return {
      open,
      toHome
    };
  }
});
</script>

<style lang='scss' scoped>
.info {
  width: 100%;
  height: 100%;
  padding: 45px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;

  > .name {
    padding: 10px 0;
    font: bold 18px/18px normal;
  }
}
</style>
